package com.sunwayworld.basemodule.rm.environment.resource.impl;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.rm.environment.resource.LimsEnvironmentDataResource;
import com.sunwayworld.basemodule.rm.environment.service.LimsEnvironmentDataService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("环境信息")
@RestController
@GikamBean
public class LimsEnvironmentDataResourceImpl implements LimsEnvironmentDataResource {

    @Autowired
    private LimsEnvironmentDataService limsEnvironmentDataService;

    @Override
    public LimsEnvironmentDataService getService() {
        return limsEnvironmentDataService;
    }

    @Log(value = "新增环境信息", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public JSONObject changeStatus(RestJsonWrapperBean jsonWrapperBean) {
        return getService().changeStatus(jsonWrapperBean);
    }
}
